<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>자료실 글 수정</title>
<script type="text/javascript">
	$(function() {
		$("#deleteFileBtn").click(function() {
			//alert("delete");
			location.href="${initParam.root}/board_deleteUploadFile.do?fileName=${requestScope.fvo.fileName}&fileNo=${requestScope.fvo.fileNo}";
		});
	});
</script>
</head>
<body>
<center>
<h2>자료실 글수정</h2>
<form method="post" action="board_updateFileUpload.do" enctype="multipart/form-data">
<input type="hidden" name="fileNo" value="${requestScope.fvo.fileNo }">
	<table rules="all" >
		<tr>
			<td>Title<input type="text" name="fileTitle" size="64" value="${requestScope.fvo.fileTitle }"></td>
		</tr>
		<tr>
			<td><textarea name="fileContent" rows="10" cols="60" style="resize:none">${requestScope.fvo.fileContent }</textarea></td>
		</tr>
		<c:choose>
			<c:when test="${requestScope.fvo.fileName==null }">
				<tr><td>
					<input type="file" name="file"><br>
				</td></tr>
			</c:when>
			<c:otherwise>
				<tr><td>
					${requestScope.fvo.fileName }
					<input type="button" value="삭제" id="deleteFileBtn">
				</td></tr>
			</c:otherwise>
		</c:choose>
	</table>
	<input type="submit" value="글수정">
	</form>
	</center>
</body>
</html>